home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / Chess++ ƒ / CChessSplashScreen.cp < prev    next >
Text File  |  1993-05-26  |  1KB  |  43 lines

  1. ////////////
  2. //
  3. //    CChessSplashScreen.cp
  4. //
  5. //    The Chess++ Splash Screen Class
  6. //    
  7. //    SUPERCLASS = CDirector
  8. //    Copyright © 1993 Steven J. Bushell. All rights reserved.
  9. //
  10. ////////////
  11.  
  12. #include <CDecorator.h>
  13. #include "CChessSplashScreen.h"
  14.  
  15. extern    CDesktop    *gDesktop;
  16. extern    CDecorator    *gDecorator;
  17.  
  18. void    CChessSplashScreen::IChessSplashScreen(CDirectorOwner *aSupervisor)
  19. {    
  20.     CDirector::IDirector(aSupervisor);    /* Initialize superclass            */
  21.     itsWindow = new(CWindow);
  22.     itsWindow->IWindow(WINDChessSplashScreen, true, gDesktop, this);
  23.  
  24.     DoChessSplashScreen();
  25. }
  26.         
  27. void    CChessSplashScreen::DoChessSplashScreen(void)
  28. {
  29.     PicHandle    thePict;
  30.     Rect        picRect;
  31.  
  32.     thePict = GetPicture(WINDChessSplashScreen);
  33.     picRect = (*thePict)->picFrame;
  34.     itsWindow->ChangeSize(picRect.right-picRect.left,picRect.bottom-picRect.top);
  35.     gDecorator->CenterWindow(itsWindow);
  36.     itsWindow->Show();
  37.  
  38.     itsWindow->Prepare();
  39.     SetOrigin(picRect.left,picRect.top);
  40.     ClipRect(&picRect);
  41.     DrawPicture(thePict,&picRect);    
  42.     ReleaseResource((Handle)thePict);
  43. }